﻿/******************************************************************************
* File description: ExpCommonMethod.h
* Function: 实验相关公共方法
* Current Version: 1.0.0
* Author: 郑佰旺
* Date: 2025-07-1
*  -----
*  Copyright by 博坤生物 .
 *****************************************************************************/


#ifndef EXPCOMMONMETHOD_H
#define EXPCOMMONMETHOD_H

#include <QObject>
#include <DbHelper.h>
#include <CommonHelper.h>
#include <StaticProperties.h>
#include <CommCommand.h>
#include <Experiment/ExperimentTimeXml.h>

class ExpCommonMethod: public QObject
{
    Q_OBJECT
private:
    ExpCommonMethod();

public:
    static ExpCommonMethod& Common();

public:
    void analysisTotalProcessExp(QString);//解析总流验
    void analysisReleasseTargetExp(QString);//解析放靶实验
    void analysisPracticeTargetExp(QString);//解析打靶实验
    void analysisShiftingTargetExp(QString);//解析转靶实验
    void analysisPurifyingExp(QString,bool isUnion=false);//解析纯化实验(包含循环的解析)
    QString checkExpRunningRule();
    QString checkConsumablesSyring(QString);
    void saveExpInfo();
    bool checkExpComponent(int,QString);
    bool checkResetStatus();
    bool checkShiftingTargetComponent(QString);
    bool checkPurifyingExpComponent(QString);

private:
    void analysisTurntable(int,QVariantMap,bool);
    void analysisSyringe(int,QVariantMap,QString,QString,bool,bool);//解析注射器
    void analysisValve(int,QVariantMap,bool,bool);//解析阀门
    void analysisCoverTheLid(int,QVariantMap,bool);
    void analysisFluidTransfer(int,QVariantMap,bool isUnion=false);//解析转液

    void analysisProductTesting(int,QVariantMap);
    void analysisBarrier(int,QVariantMap);//解析挡板
    void analysisAcquisitionTarget(int,QVariantMap);//解析取靶
    void analysisClampingJaw(int,QVariantMap);//解析夹爪
    void analysisOpenTheLid(int,QVariantMap);//解析开盖
    void analysisRotaryCapClamp(int module,QVariantMap map);

    void analysisTransmissionTarget(int,QVariantMap);//解析加速端回靶

    void analysisSuctionTarget(int,QVariantMap);//吸取梭体
    void analysisCooling(int,QVariantMap);//冷却
    void analysisDry(int,QVariantMap);//干燥
    void analysisMoveTarget(int,QVariantMap);//锁体组合运行
    void analysisLockedUp(int,QVariantMap);//锁死
    void analysisFeed(int,QVariantMap);//进料
    void analysisSkip(int,QVariantMap);//解析跳过
    void analysisWait(int module,QVariantMap map,bool isCircle=false,bool isUnion=false);//解析等待
    void analysisPause(int,QVariantMap);//解析暂停
    void analysisLinkage(int,QVariantMap);//解析联动
    void analysisActivityTesting(int,QVariantMap);//解析活检
    void analysisHeating(int,QVariantMap,bool);//解析加热

private:
    int step;
    int unionStep;
    int unionNumber;
    ExperimentTimeXml expTimeXml;
};

#endif // EXPCOMMONMETHOD_H
